package tech.aistar.corejava.day06.extend;

/**
 * Created by 李雨昂 on 2019/7/22.
 */
public class Animal {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Animal() {
        System.out.println("父类..Animal()空参构造被调用了...");
    }

    public Animal(String name){
        System.out.println("Animal()有参构造被调用了..");
    }
    public void seelpint(){
        System.out.println("睡觉");
    }
    public void spark(){
        System.out.println("叫.........");
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("Animal{");
        sb.append("name='").append(name).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
